import http from './index'

export const getBanner = () => http({
	url: '/getbanner'
})

//获取一级分类信息(首页快速分类导航)
export const getCate = () => http({
	url: '/getcate'
})

// 获取商品信息(首页)
export const getHortgoods = () => http({
	url: '/gethortgoods'
})

// 获取商品全部分类信息
export const getHomeCates = () => http({
	url: '/getcates'
})

// 获取一级分类下的所有商品
export const getGoodlist = (data) => http({
	url: '/getgoodlist',
	data
})

// 获取一个商品信息
export const getGoodsinfo = (data) => http({
	url: '/getgoodsinfo',
	data
})

// 封装一个发送验证码接口
export const SendSMS = (data) => http({
	url: '/sms',
	data
})

//封装一个手机号验证登录
export const smsLogin = data => http({
	url: '/smslogin',
	method: 'post',
	data
})

//封装一个一键登录
export const wxLogin = data => http({
	url: '/wxlogin',
	method: 'post',
	data
})

// 封装一个搜索接口
export const Search = data => http({
	url: '/search',
	data
})

// 购物车添加
export const getCartadd = (data,header) =>http({
	url:'/cartadd',
	method:'post',
	data,
	header:true
})

// 购物车列表
export const cartLists = data => http({
	url:'/cartlist',
	data,
	header:true
}) 

// 购物车++
export const carteDit = (data) =>http({
	url:'/cartedit',
	method:'post',
	data,
	header:true
})

//购物车删除
export const cartDelete = (data) =>http({
	url:'/cartdelete',
	method:'post',
	data,
	header:true
})

// 地址查询
export const addreSslist = (data) =>http({
	url:'/addresslist',
	data,
})

// 地址添加
export const addRessadd = (data) =>http({
	url:'/addressadd',
	method:'post',
	data,
	header:true
})

// 地址编辑
export const addreSsedit = (data) =>http({
	url:'/addressedit',
	method:'post',
	data,
	header:true
})

// 地址删除
export const addreSsremove = (data) =>http({
	url:'/addressremove',
	method:'post',
	data,
	header:true
})
